package api

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

type Data map[string]interface{}

func Response(context *gin.Context, httpStatus int, code int, msg string, data Data) {
	context.JSON(httpStatus, gin.H{
		"code": code,
		"msg":  msg,
		"data": data,
	})
}
func ResponseOK(context *gin.Context, msg string, data Data) {
	context.JSON(http.StatusOK, gin.H{
		"code": "0",
		"msg":  msg,
		"data": data,
	})
}
